import { chuFa, isLocal } from '@/utils';
import { Slider, Space, Tooltip } from 'antd';

// 已实现
export function YSXYingKui() {
  return {
    title: '已实现盈亏',
    dataIndex: 'realised_pnl',
    render: (text: any, record: any) => (
      <Tooltip
        title={
          <>
            <div>减仓盈亏：{record?.ysxYingKui?.pnl_pnl}</div>
            <div>资金费用：{record?.ysxYingKui?.pnl_fund}</div>
            <div>交易手续费：{record?.ysxYingKui?.pnl_fee}</div>
          </>
        }
      >
        <span className={`${record?.ysxYingKui?.pnl > 0 ? 'color-red' : 'color-green'}`}>
          {Number(record?.ysxYingKui?.pnl)?.toFixed(2)} USDT
          {/* {isLocal() && <p>总: {record?.ysxYingKui?.pnl}</p>} */}
        </span>
      </Tooltip>
    ),
  };
}

/*

*/
// 收益率滑块
export function ShouYiLvSlider({ shouYiLv, changeShouYiLv }: any) {
  const marks: any = { 0: '0%', 50: '50%', 100: '100%', 150: '150%', 200: '200%' };
  return <Slider value={shouYiLv} min={0} max={200} marks={marks} onChange={changeShouYiLv} />;
}
